﻿
Partial Class store_UCNotes
    Inherits System.Web.UI.UserControl

    Public Sub Display(p As CProduct, list As CProductList)
        If Me.Parent.Controls.Count Mod 2 = 1 Then row.Attributes.Add("class", "alt_row")


        With lnkSpeaker
            .Text = CUtilities.Truncate(p.SpeakerName, 12)
            .NavigateUrl = CSitemap.Notes(Nothing, p.ProductSpeakerId)
        End With


        litTitle.Text = CUtilities.Truncate(p.ProductName, 50)
        With lnkTitle
            If p.Files.HasHtm Then
                .ToolTip = IO.Path.GetFileName(p.Files.FirstHtm.FileName) & vbCrLf & CUtilities.Truncate(p.ProductDescriptionOrParent, 500)
            ElseIf p.Files.HasPdfOrWord Then
                .ToolTip = IO.Path.GetFileName(p.Files.FirstPdfOrWord.FileName) & vbCrLf & CUtilities.Truncate(p.ProductDescriptionOrParent, 500)
            End If

            If p.Files.HasHtm Then
                .NavigateUrl = CConfig.DropboxUrl(p.Files.FirstHtm.FileName)
            Else
                .NavigateUrl = CSitemap.Decide(p)
            End If
        End With

        With lnkProduct
            .Text = p.ProductCreated.ToString("d-MMM-yy")
            .ToolTip = p.DateString()
            .NavigateUrl = CSitemap.Decide(p) & "#notes"
        End With
    End Sub

End Class
